checkLogin();
function getCookie(name) {
    var strCookie = document.cookie;
    var arrCookie = strCookie.split("; ");
    for (var i = 0; i < arrCookie.length; i++) {
        var arr = arrCookie[i].split("=");
        if (arr[0] == name)
            return arr[1];
    }
    return "";
}
/* 读取cookie识别登录状态 */
function checkLogin() {
    if (getCookie("music_identify") != "" && getCookie("music_key_code") != "") {
        var id = getCookie("music_identify");
         var   pass = getCookie("music_key_code");
    }else
    {
    	window.top.location.href=getRealPath()+"/login.html";
    }
}
function getRealPath(){

	  var localObj = window.location;
	  var contextPath = localObj.pathname.split("/")[1];
	  var basePath = localObj.protocol + "//" + localObj.host + "/"+ contextPath;

    return basePath ;
}

                       